<template>
  <div>
    <div class="middleBar">
      <div class="middleBar-all">
        <div class="middleBar-items" v-for="(v,i) in imgurl,title" :key="i" @click="fun(i)">
          <img :src="imgurl[i]"/>
          <span>{{title[i]}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:["imgurl","title"],
  methods:{
    fun(i){
        if(this.title[i] == "上新精选"){
          this.$router.replace("/era")
        }else if(this.title[i] == "小米众筹"){
          this.$router.push("/erb")
        }else if(this.title[i] == "有品秒杀"){
          this.$router.push("/erc")
        }else if(this.title[i] == "有品生活"){
          this.$router.push("/erd")
        }else if(this.title[i] == "小米自营"){
          this.$router.push("/ere")
        }
      }
    }
};
</script>

<style scoped>
.middleBar {
  position: relative;
  box-sizing: border-box;
  display: flex;
  -webkit-box-orient: vertical;
  flex-direction: column;
  align-content: flex-start;
  flex-shrink: 0;
  width: 100%;
  padding-bottom: 0.01rem;
  padding-top: 0.7rem;
}
.middleBar-all {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
  margin-bottom: 0.14rem;
  margin-left: 0.18rem;
}
.middleBar-items {
  border: 0px solid black;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  -webkit-box-pack: center;
  width: 0.65rem;
  height: 0.72rem;
  text-align: center;
  -webkit-box-align: center;
  align-items: center;
}
.middleBar-items img {
  display: flex;
  width: 0,5rem;
  height: 0.5rem;
  box-sizing: border-box;
  object-fit: contain;
}
.middleBar-items span {
  white-space: nowrap;
  position: relative;
  box-sizing: border-box;
  display: block;
  flex-direction: column;
  align-content: flex-start;
  flex-shrink: 0;
  font-size: 0.12rem;
  margin-top: 0.05rem;
  color: rgb(0, 0, 0);
  height: 0.17rem;
  line-height: 0.17rem;
  text-align: center;
}
</style>